home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
news
/
moderating
/
mod.procmail.Z
/
mod.procmail
Wrap
Internet Message Format
|
1994-05-06
|
4KB
From sridhar@homecheese.eas.asu.edu Wed Apr 20 15:40:49 1994
Received: from homecheese.eas.asu.edu by sparky.sterling.com
id AA18215; Wed, 20 Apr 1994 15:40:38 -0500
Return-Path: <sridhar@homecheese.eas.asu.edu>
Received: from localhost (sridhar@localhost) by homecheese.eas.asu.edu (8.6.4/8.6.4) id NAA07183; Wed, 20 Apr 1994 13:45:37 -0700
Date: Wed, 20 Apr 1994 13:45:36 -0700 (MST)
From: Sridhar Venkataraman <sridhar@asuvax.eas.asu.edu>
Subject: Moderator stuff.. Procmail help..
To: kent@sterling.com
Message-Id: <Pine.3.89.9404201325.A7154-0100000@homecheese.eas.asu.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: OR
Kent,
This is intended for anyone having access to procmail.
Feel free to archive or ignore or whatever. :-)
Sridhar.
-------
# Using Procmail to moderate a Usenet group.
# .procmailrc
# by Sridhar Venkataraman <sridhar@asuvax.eas.asu.edu>
# for rec.food.veg.cooking.
# Short guide to conditions in recipes...
# c - continue
# f - consider the pipe as filter
# h - Feed the header to pipe.
# A - depends on last successful recipe.
# This recipe converts any mail submissions to the moderation address to appear
# like posting submissions.
:cf
^TOrfvc-mod@utcc.utoronto.ca
| formail -I "To: rec-food-veg-cooking@uunet.uu.net" -a "Newsgroups: rec.food.veg.cooking"
# The following recipe recognized the submissions which are sent by
# the psuedo-user news. In this case, the complete posting appears
# just after the header. Hence the header is chopped.
:0cf
* ^From:.*news@
* ^TO.*rec-food-veg-cooking@
| sed -n '2,/^Path:/\!p' | formail -a "To: rec-food-veg-cooking@"
# This is the start of the recipe cluster that recognizes a submission
# to rec.food.veg.cooking. Saves a copy in the folder rfvc.
:c
^TOrec-food-veg-cooking@
rfvc
# Save the Newsgroups, Subject, From, Date in some variables.
:Ach
newsgroups=|formail -a "Newsgroups: rec.food.veg.cooking" \
-x "Newsgroups:"
:Ach
subject=|formail -x "Subject:"
:Ach
date=|formail -x "Date:"
:Ach
from=|formail -x "From:"
:Ach
replyto=|formail -rtx "To:"
# If the poster doesn't want autoreplies, he supplies a keyword of
# ignore in the posting. The following recipe appends the poster's
# address to the file $HOME/system/rfvc.
:0 Ach:rfvc.lock
* Keywords:.*ignore
| (cat > /dev/null ; echo "$replyto" >> $HOME/system/rfvc)
# If the poster doesn't appear in the above file, he/she gets an
# autoreply. This way I have been able to fix several machines'
# reply-able addresses. Also people don't wonder why they don't see
# the posting immediately on moderated groups.
:0 Ach:rfvc.lock
* !?grep -i $replyto $HOME/system/rfvc
| (formail -rt -I "Subject: Acknowledgement [l/m 94/03/02]" -i "Received:" \
-I "From: rfvc submissions <rfvc-request@utcc.utoronto.ca>" ; \
echo "From:\t\t$from\nDate:\t$date\nNewsgroups:\t$newsgroups\nSubject:\t$subject" ; \
cat /usr/people/sridhar/misc/rfvc/rec )| $SENDMAIL -t -oi
# Finally the unnecessary headers are ripped off and the bare
# essentials (headers + body) are saved as a MH-style folder. Each
# posting is saved as a file. You can peruse the postings, make any
# changes if need be and use "inews -h < <file>" to post any file.
:Acf
| formail -I "Apparently-To:" -I "To:" -I "Date:" \
-a "Newsgroups: rec.food.veg.cooking" \
-I "Sender:"\
-I "Path:"\
-a "Organization: -" \
-a "Archive-Name: " \
-a "Followup-To: " \
-I "Lines:" \
-I "In-Reply-To:" \
-I "Approved: sridhar@asuvax.eas.asu.edu" \
-I "X-Newsreader:" \
-I "Nntp-Posting-Host:" -I "Originator:" \
-I "Received:" -I "Return-Path:" | tail +2
:Ac
$HOME/misc/rfvc/misc/.
# Just to get a copy of headers for quick overview.
:Ah
/usr/mail/sridhar
# In case of questions on procmail refer the appropriate manual pages.
# In case of any specific questions on the above recipes, you can get
# hold of me - Sridhar <sridhar@asuvax.eas.asu.edu>